var util = require('../../libs/util.js');
var app = getApp();
var ringChart = null;
Page({
  data: {
    hasData: false,
    orderId:""
  },
  onShareAppMessage: function () {
    return {
      title: app.appName,
      path: '/pages/index/index'
    }
  },
  onPullDownRefresh: function () {
    //wx.stopPullDownRefresh()
  },
  onLoad: function (e) {
    var that = this;
    wx.setNavigationBarTitle({ "title": app.appName +"--配送综述" });
    that.setData({
      orderId:e.id
    })

    that.loadData();
  },
  loadData: function () {
    var that = this;
    wx.showLoading({
      title: '请稍候...',
    });
    util.getData("/xypapi/driverPrice/priceDetail", { id: that.data.orderId,onlyDriverPrice:true }, function (res) {
      console.log(res.data.data)
      if (res.data.success) {
        var data = res.data.data;
        that.setData({
          priceList: data.remark,
          totalPrice: data.price
        })
      }
      wx.hideLoading();
    });
  },
  gotoScan: function () {
    util.driverScan();
  },
  gotoDriverHome: function () {
    wx.redirectTo({
      url: '/pages/driver/orderList'
    })
  },
  gotoInfo: function () {
    wx.redirectTo({
      url: '/pages/driver/driverInfo'
    })
  },
  gotoCurrentOrder: function () {
    wx.redirectTo({
      url: '/pages/driver/currentOrder'
    })
  },
  gotoIotBox: function () {
    wx.redirectTo({
      url: '/pages/driver/iotBox'
    })
  },
  gotoHistoryOrder: function () {
    wx.redirectTo({
      url: '/pages/driver/historyOrder'
    })
  }
})
